package org.zdd.bookstore.model.service;

import org.zdd.bookstore.model.entity.User;
import org.zdd.bookstore.vo.UserVo;

import javax.servlet.http.HttpSession;

public interface IMailService {

    void sendSimpleMail(String to, String subject, String content) throws Exception;

    /**
     * 激活用户
     * @param to
     * @param subject
     * @param content
     * @throws Exception
     */
    void sendHtmlMail(String to, String subject, String content) throws Exception;

    /**
     * 随机生成6位数的验证码
     *
     * @return String code
     */
    String randomCode();

    /**
     * 校验用户名和邮箱
     * @param user
     * @return
     */
    String selectUserByUsername(User user);

    /**
     * 通过邮箱找回密码
     * @param email
     * @param session
     * @return
     */
    Boolean sendMimeMail2(String email, HttpSession session);

    /**
     * 校验验证码并重置更改密码
     * @param userVo
     * @param session
     * @return
     */
    Boolean updateUserPassword(UserVo userVo, HttpSession session);
}
